﻿<Window x:Class="CPPEI.Coolzon.UI.DataPartLib.XProperty.Editors.GridColumnEditWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:CPPEI.Coolzon.UI.DataPartLib.XProperty.Editors"
        xmlns:datapartLib="clr-namespace:CPPEI.Coolzon.UI.DataPartLib"
        xmlns:ui="clr-namespace:CPPEI.Coolzon.UI;assembly=CPPEI.Coolzon.UI"
        mc:Ignorable="d"
        Title="表格列" Height="410" Width="450" Topmost="True" ShowInTaskbar="False" Loaded="Window_Loaded" WindowStartupLocation="CenterScreen"
        Style="{DynamicResource WindowStyle}">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="35"/>
        </Grid.RowDefinitions>
        <Grid  Grid.Column="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <StackPanel Style="{DynamicResource ButtonPanelBackground}" Grid.Row="0" Orientation="Horizontal" MinWidth="130">
                <Button Name="_ctlAdd" Style="{DynamicResource AddButtonStyle}" FontSize="12" VerticalContentAlignment="Center" Width="25" Margin="3" ToolTip="增加" Click="_ctlAdd_Click"/>
                <Button Name="_ctlRemove" Style="{DynamicResource RemoveButtonStyle}" FontSize="12" Width="25" Margin="3" ToolTip="删除" Click="_ctlRemove_Click"/>
                <Button Name="_ctlUp" Style="{DynamicResource UpButtonStyle}" FontSize="12" Width="25" Margin="3" ToolTip="上移" Click="_ctlUp_Click"/>
                <Button Name="_ctlDown" Style="{DynamicResource DownButtonStyle}" FontSize="12" Width="25" Margin="3" ToolTip="下移" Click="_ctlDown_Click"/>
            </StackPanel>
            <TreeView Name="_ctlGridColumnList" Grid.Row="1" MinWidth="100" SelectedItemChanged="_ctlGridColumnList_SelectedItemChanged" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
                <TreeView.ItemContainerStyle>
                    <Style TargetType="{x:Type TreeViewItem}">
                        <Setter Property="IsSelected" Value="{Binding Path=IsSelected, Mode=TwoWay}"/>
                        <Setter Property="IsExpanded" Value="{Binding Path=IsExpanded, Mode=TwoWay}"/>
                    </Style>
                </TreeView.ItemContainerStyle>
                <TreeView.ItemTemplate>
                    <HierarchicalDataTemplate DataType="{x:Type local:GridColumnModel}" ItemsSource="{Binding Columns}">
                        <TextBlock Text="{Binding Path=Name}" ToolTip="{Binding Path=Caption}" MinWidth="25">
                        </TextBlock>
                    </HierarchicalDataTemplate>
                </TreeView.ItemTemplate>
            </TreeView>
        </Grid>
        <GridSplitter  BorderBrush="Gray" BorderThickness="1" Width="5" />
        <Grid Grid.Column="1" Name="_ctlGridColumnDetail" IsEnabled="False">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <TextBlock Grid.Row="0" Text="名称" HorizontalAlignment="Right" Margin="3" />
            <ui:NameTextbox Grid.Row="0" Grid.Column="1" Text="{Binding Name, Mode=TwoWay}" Margin="2" />
            <TextBlock Grid.Row="1" Text="描述" HorizontalAlignment="Right" Margin="3" />
            <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Caption, Mode=TwoWay}" Margin="2" />
            <TextBlock Grid.Row="2" Text="DataItemId" HorizontalAlignment="Right" Margin="3" />
            <TextBox Grid.Row="2" Grid.Column="1" Text="{Binding DataItemId, Mode=TwoWay}" Margin="2" />
            <TextBlock Grid.Row="3" Text="前置图片" HorizontalAlignment="Right" Margin="3" />
            <Button Style="{DynamicResource  ShortButtonStyle}" Grid.Row="3" Grid.Column="1" Content="..." Width="30" HorizontalAlignment="Left" Margin="5,0,0,0" Click="Pre_Click"/>
            <TextBlock Grid.Row="4" Text="后置图片" HorizontalAlignment="Right" Margin="3" />
            <Button Style="{DynamicResource  ShortButtonStyle}"  Grid.Row="4" Grid.Column="1" Content="..." Width="30" HorizontalAlignment="Left" Margin="5,0,0,0" Click="Suf_Click"/>
            <TextBlock Grid.Row="5" Text="水平对齐方式" HorizontalAlignment="Right" Margin="3" />
            <ComboBox Name="_ctlHcombobox" Grid.Row="5" Grid.Column="1" SelectedItem="{Binding HAlignment, Mode=TwoWay}" Margin="2"  IsEditable="False">
            </ComboBox>
            <TextBlock Grid.Row="6" Text="垂直对齐方式" HorizontalAlignment="Right" Margin="3" />
            <ComboBox Name="_ctlVcombobox" Grid.Row="6" Grid.Column="1" SelectedItem="{Binding VAlignment, Mode=TwoWay}" Margin="2"  IsEditable="False">
            </ComboBox>
            <TextBlock Grid.Row="7" Text="宽度" HorizontalAlignment="Right" Margin="3" />
            <TextBox Grid.Row="7" Grid.Column="1" Text="{Binding Width, Mode=TwoWay}" Margin="2" />
            <TextBlock Grid.Row="8" Text="文本格式" HorizontalAlignment="Right" Margin="3" />
            <TextBox Grid.Row="8" Grid.Column="1" Text="{Binding TextFormat, Mode=TwoWay}" Margin="2" />
            <TextBlock Grid.Row="9" Text="值类型" HorizontalAlignment="Right" Margin="3" />
            <TextBox Grid.Row="9" Grid.Column="1" Text="{Binding ValueType, Mode=TwoWay}" Margin="2" />
            <TextBlock Grid.Row="10" Text="内间距" HorizontalAlignment="Right" Margin="3" />
            <TextBox Grid.Row="10" Grid.Column="1" Text="{Binding Padding, Mode=TwoWay}" Margin="2" />
        </Grid>
        <Grid Grid.Row="2" Grid.ColumnSpan="2">
            <StackPanel Margin="5" Orientation="Horizontal" HorizontalAlignment="Center">
                <Button Style="{DynamicResource  SubmitOrCancelButtonStyle}" Content="确定" Margin="0,0,20,0" Click="Button_Click" Width="75" />
                <Button Style="{DynamicResource  SubmitOrCancelButtonStyle}" Name="cancel" Content="取消" Margin="20,0,0,0" Click="cancel_Click" Width="75"></Button>
            </StackPanel>
        </Grid>
    </Grid>
</Window>
